import { createRouter, createWebHistory,RouteRecordRaw } from "vue-router";

const routes:Array<RouteRecordRaw>=[
  // 嵌套路由与命名视图
  {
    path:"/",
    component:()=>import("../components/footer.vue"),
    children:[
      {
        // name形式代替path
        // a标签形式代替path
        // 编程式导航形式代替path
          path:"",
          // 为空时，默认渲染该路由下的index组件
          component:()=>import("../components/login.vue")
      },
      {
          path:"/reg",
          component:()=>import("../components/reg.vue")
      },
    ]
},

]

const router=createRouter({
  // createWebHistory(),createWebHashHistory(),createMemoryHistory()
  history:createWebHistory(),
  routes
})

export default router